<template>
  <div>
    <h1>{{ msg }}</h1>
    <Son :userName="18" @change1="val"></Son>
  </div>
</template>

<script>
import Son from "./Son.vue";
export default {
  name: "parent",
  data() {
    return {
      msg: "父组件模板显示的内容",
    };
  },
  methods: {
    val(age1111){
      console.log('传递过来的年龄:' + age1111);
    }
  },
  components: {Son},
};
</script>

<style>
h1 {
  color: black;
}
</style>